/*
Brittany Jakubiak	
Proposal title: "Do the benefits of receiving affectionate touch generalize
beyond satisfied couples?"


HYPOTHESES

Stated-Hyp1: "I hypothesize that people who imagine receiving support from their partners will report more positive experiences on all outcomes" 

	Test-Hyp1: Percieved affection will be higher in touch vs. no touch condition.
	Test-Hyp2: State security will be higher in touch vs. no touch condition.	
	Test-Hyp3: Cognitive interdependence will higher in touch vs. no touch condition.	
	Test-Hyp4: Social inclusion will be higher in touch vs. no touch condition.	

	
Stated-Hyp2: "people who report poorer relationship quality will report less positive experiences across outcomes"

	Test-Hyp5: Percieved affection will increase with relationship quality.
	Test-Hyp6: State security will increase with relationship quality.
	Test-Hyp7: Cognitive interdependence will increase with relationship quality.	
	Test-Hyp8: Social inclusion will increase with relationship quality.

Stated-Hyp3: "there will be an interaction between condition and relationship quality such that participants who have poorer relationship quality will respond to affectionate touch differently than participants who are more satisfied with their relationships."

	Test-Hyp9: The effect of touch on Percieved affection will vary by relationship quality.
	Test-Hyp10: The effect of touch on State security will vary by relationship quality.	
	Test-Hyp11: The effect of touch on Cognitive interdependence will vary by relationship quality.	
	Test-Hyp12: The effect of touch on Social inclusion will vary by relationship quality.	


Stated-Hyp4: "I will test these hypotheses in two discussion contexts (conflict and neutral)... these results may emerge during conflict because distressed couples behave more negatively during conflict than distressed couples."

	Test-Hyp13: Percieved affection will be higher in touch vs. no touch condition. WITHIN CONFLICT CONTEXT
	
	Test-Hyp14: State security will be higher in touch vs. no touch condition.	WITHIN CONFLICT CONTEXT
	
	Test-Hyp15: Cognitive interdependence will higher in touch vs. no touch condition. WITHIN CONFLICT CONTEXT	
	
	Test-Hyp16: Social inclusion will be higher in touch vs. no touch condition. WITHIN CONFLICT CONTEXT	

	Test-Hyp17: Percieved affection will increase with relationship quality. WITHIN CONFLICT CONTEXT
	
	Test-Hyp18: State security will increase with relationship quality. WITHIN CONFLICT CONTEXT
	
	Test-Hyp19: Cognitive interdependence will increase with relationship quality. WITHIN CONFLICT CONTEXT
	
	Test-Hyp20: Social inclusion will increase with relationship quality. WITHIN CONFLICT CONTEXT
	
	Test-Hyp21: The effect of touch on Percieved affection will vary by relationship quality. WITHIN CONFLICT CONTEXT
	
	Test-Hyp22: The effect of touch on State security will vary by relationship quality. WITHIN CONFLICT CONTEXT
	
	Test-Hyp23: The effect of touch on Cognitive interdependence will vary by relationship quality.	WITHIN CONFLICT CONTEXT
	
	Test-Hyp24: The effect of touch on Social inclusion will vary by relationship quality. WITHIN CONFLICT CONTEXT	
	
	*Test-Hyp25: Percieved affection will be higher in touch vs. no touch condition. WITHIN NEUTRAL CONTEXT
		
	*Test-Hyp26: State security will be higher in touch vs. no touch condition.	WITHIN NEUTRAL CONTEXT
		
	*Test-Hyp27: Cognitive interdependence will higher in touch vs. no touch condition. WITHIN NEUTRAL CONTEXT
		
	*Test-Hyp28: Social inclusion will be higher in touch vs. no touch condition. WITHIN NEUTRAL CONTEXT

	*Test-Hyp29: Percieved affection will increase with relationship quality. WITHIN NEUTRAL CONTEXT
		
	*Test-Hyp30: State security will increase with relationship quality. WITHIN NEUTRAL CONTEXT

	*Test-Hyp31: Cognitive interdependence will increase with relationship quality. WITHIN NEUTRAL CONTEXT

	*Test-Hyp32: Social inclusion will increase with relationship quality. WITHIN NEUTRAL CONTEXT

	*Test-Hyp33: The effect of touch on Percieved affection will vary by relationship quality. WITHIN NEUTRAL CONTEXT

	*Test-Hyp34: The effect of touch on State security will vary by relationship quality. WITHIN NEUTRAL CONTEXT

	*Test-Hyp35: The effect of touch on Cognitive interdependence will vary by relationship quality.	WITHIN NEUTRAL CONTEXT	
		
	*Test-Hyp36: The effect of touch on Social inclusion will vary by relationship quality. WITHIN NEUTRAL CONTEXT		
	
********************************************************************************
NOTES:

- Married participants were sampled.	
- questions D5 and D6 pertain to intentions, not to the outcome construct. 

- We are combining items about relationship quality into a single scale of 10 
items. 
*/

clear all
use "Jakubiak1098.dta", clear

********************************************************************************

* INDICATORS OF EXPERIMENTAL MANIPULATIONS

	tab COND

	/*
	COND	Experimental condition assigned	1	1 Conflict; touch
			2	2 Conflict; no touch
			3	3 No conflict; touch
			4	4 No conflict; no touch
			*/
	
	* touch
	recode COND (1=1) (3=1) (2=0) (4=0), gen(touch)
	tab touch
	
	* conflict
	recode COND (1/2=1) (3/4=0), gen(conflict)
	tab conflict
	
* OUTCOME MEASURES

* 1. perceive affection from the partners’ behavior (1 item created for use in this study), 

	/*
	In thinking about the interaction you just imagined, to what extent would you be thinking
	that your partner has genuine affection toward you (that your partner truly cares for you)?
	*/
	
	tab D1
	replace D1=. if D1>6
	clonevar perc_affection=D1
	tab perc_affection

* 2. state security/stress items 
	/*

	D2A	[Comforted] In thinking about the interaction you just imagined, to what extent would you be feeling each of the following emotions?
		
	D2B	[Secure] In thinking about the interaction you just imagined, to what extent would you be feeling each of the following emotions?
			
	D2C	[Anxious] In thinking about the interaction you just imagined, to what extent would you be feeling each of the following emotions? REVERSE
			
	D2D	[Safe] In thinking about the interaction you just imagined, to what extent would you be feeling each of the following emotions?
		
	D2E	[Stressed out] In thinking about the interaction you just imagined, to what extent would you be feeling each of the following emotions?	REVERSE

	D2F	[Loved] In thinking about the interaction you just imagined, to what extent would you be feeling each of the following emotions?
		
	D2G	[Protected] In thinking about the interaction you just imagined, to what extent would you be feeling each of the following emotions?	
		
	D2H	[Upset] In thinking about the interaction you just imagined, to what extent would you be feeling each of the following emotions? REVERSE
	*/	
		
	* recode missing	
	foreach var in D2A D2B D2C D2D D2E D2F D2G D2H {
		replace `var' =. if `var'>6
		tab `var'
	}
	
	* correct reverse coded items
	foreach var in D2C D2E D2H {
		replace `var' =7-`var' 
		tab `var'
	}
	
	gen security = D2A+ D2B +D2C +D2D +D2E+ D2F +D2G +D2H
	tab security
	
* 2. cognitive interdependence items	
	/*	
	D3A	[a sense of “oneness” or connection with your spouse.] In thinking about the interaction you just imagined, to what extent would you be feeling…
			
	D3B	[happy in your relationship?] In thinking about the interaction you just imagined, to what extent would you be feeling…
		
	D3C	[optimistic about the future of your relationship?] In thinking about the interaction you just imagined, to what extent would you be feeling…
		
	D3D	[satisfied with your life?] In thinking about the interaction you just imagined, to what extent would you be feeling…
		
	D3E	[that, in most ways, your life is close to your ideal?] In thinking about the interaction you just imagined, to what extent would you be feeling…
	*/

	* missing recode
	foreach var in D3A D3B D3C D3D D3E {
		replace `var' = . if `var'>10
		tab `var'
	}

	gen interdependence= D3A +D3B+ D3C+ D3D +D3E
	tab interdependence
	
*3. Social Inclusion/Loneliness

/*
D4A	[I feel lonely.] Right now, how true is the following statement for you? REVERSE
	
D4B	[I feel isolated from others.] Right now, how true is the following statement for you? REVERSE
	
D4C	[I can count on my spouse to listen to me when I need to talk.] Right now, how true is the following statement for you?
	
D4D	[I can count on my spouse to be dependable when I need help.] Right now, how true is the following statement for you?
*/

	* recode missing
	foreach var in D4A D4B D4C D4D {
		replace `var'=. if `var'>100
		tab `var'
	}
	
	* correct reverse coding
	foreach var in D4A D4B  {
		replace `var'=100-`var' // because scale starts with 0
		tab `var'
	}	
	
	gen inclusion = D4A +D4B +D4C +D4D
	tab inclusion
 	
* MODERATORS

* marital quality

/*
B1	Please indicate the degree of happiness, all things considered, of your relationship.
	// 7 response categories
	
B2	I have a warm and comfortable relationship with my partner.
	
B3	How rewarding is your relationship with your partner?
		
B4	In general, how satisfied are you with your relationship?
	
B5	In general, how often do you think that things between you and your partner are going well?	
	
B6	If I had my life to live over, I would marry the same person.
	
B7	My relationship with my partner makes me happy.

B8	I really feel like part of a team with my partner.
	
B9	How well does your partner meet your needs?

B10	To what extent has your relationship met your original expectations?
*/	
	
	* recode missing
	forval i=1/10 {
		tab B`i'
		replace B`i'=. if B`i'>6
	}
	
	* the number of response categories and reverse/direct coding varies. And responses start with 0 
	forval i=1/10 {
		tab B`i', nol
	}
	
	* recode so all responses start with 1
	forval i=1/10 {
		replace B`i'= B`i'+1
	}	
	
	* recode all scales so that all response categories have equal weight (weight all vars to have a weight of 6)
	
	replace B1 = B1/7*6 if B1!=.
	tab B1
	
	gen maritalquality= B1+B2+B3+B4+B5+B6+B7+B8+B9+B10
	tab maritalquality
	
********************************************************************************

* ANALYSIS
	
*Test-Hyp1: Percieved affection will be higher in touch vs. no touch condition.
	reg perc_affection i.touch
	// do not reject. 0.000
	tess 1.touch +, init(Jakubiak1098) bonf(4)
	
*Test-Hyp2: State security will be higher in touch vs. no touch condition.	
	reg security i.touch
	// do not reject. 0.000
	tess 1.touch +, bonf(4)
	
*Test-Hyp3: Cognitive interdependence will higher in touch vs. no touch condition.	
	reg interdependence i.touch
	// do not reject. 0.000
	tess 1.touch +, bonf(4)
	
*Test-Hyp4: Social inclusion will be higher in touch vs. no touch condition.	
	reg inclusion i.touch
	// reject. 0.453
	tess 1.touch +, bonf(4)
	
*Test-Hyp5: Percieved affection will increase with relationship quality.
	reg perc_affection maritalquality
	// do not reject. 0.000
	tess maritalquality +, bonf(4)	
	
*Test-Hyp6: State security will increase with relationship quality.
	reg security maritalquality
	// do not reject. 0.000
	tess maritalquality +, bonf(4)	
	
*Test-Hyp7: Cognitive interdependence will increase with relationship quality.	
	reg interdependence maritalquality
	// do not reject. 0.000
	tess maritalquality +, bonf(4)	
	
*Test-Hyp8: Social inclusion will increase with relationship quality.
	reg inclusion maritalquality
	// do not reject. 0.000
	tess maritalquality +, bonf(4)	
	
*Test-Hyp9: The effect of touch on Percieved affection will vary by relationship quality.
	reg perc_affection c.maritalquality##i.touch
	// reject. 0.856
	tess c.maritalquality#1.touch, bonf(4)		

*Test-Hyp10: The effect of touch on State security will vary by relationship quality.	
	reg security c.maritalquality##i.touch
	// reject. 0.117	
	tess c.maritalquality#1.touch, bonf(4)	
	
*Test-Hyp11: The effect of touch on Cognitive interdependence will vary by relationship quality.	
	reg interdependence c.maritalquality##i.touch
	// reject. 0.519		
	tess c.maritalquality#1.touch, bonf(4)	
	
*Test-Hyp12: The effect of touch on Social inclusion will vary by relationship quality.	
	reg inclusion c.maritalquality##i.touch
	// reject. 0.030
	// Bonferroni corrected p-val threshold
	di 0.05/4 // 0.0125
	tess c.maritalquality#1.touch, bonf(4)		
	
	
	
*Test-Hyp13: Percieved affection will be higher in touch vs. no touch condition. WITHIN CONFLICT CONTEXT
	reg perc_affection i.touch if conflict==1
	// do not reject. 0.000		
	tess 1.touch +, bonf(4)	
	
*Test-Hyp14: State security will be higher in touch vs. no touch condition.	WITHIN CONFLICT CONTEXT
	reg security i.touch if conflict==1
	// do not reject. 0.000
	tess 1.touch +, bonf(4)	
	
*Test-Hyp15: Cognitive interdependence will higher in touch vs. no touch condition. WITHIN CONFLICT CONTEXT	
	reg interdependence i.touch if conflict==1
	// do not reject. 0.000
	tess 1.touch +, bonf(4)	
	
*Test-Hyp16: Social inclusion will be higher in touch vs. no touch condition. WITHIN CONFLICT CONTEXT	
	reg inclusion i.touch if conflict==1
	// reject. 0.316
	tess 1.touch +, bonf(4)	
	
*Test-Hyp17: Percieved affection will increase with relationship quality. WITHIN CONFLICT CONTEXT
	reg perc_affection maritalquality if conflict==1
	// do not reject. 0.000
	tess maritalquality +, bonf(4)	
	
*Test-Hyp18: State security will increase with relationship quality. WITHIN CONFLICT CONTEXT
	reg security maritalquality if conflict==1
	// do not reject. 0.000
	tess maritalquality +, bonf(4)	
	
*Test-Hyp19: Cognitive interdependence will increase with relationship quality. WITHIN CONFLICT CONTEXT
	reg interdependence maritalquality if conflict==1
	// do not reject. 0.000	
	tess maritalquality +, bonf(4)	
	
*Test-Hyp20: Social inclusion will increase with relationship quality. WITHIN CONFLICT CONTEXT
	reg inclusion maritalquality if conflict==1
	// do not reject. 0.000
	tess maritalquality +, bonf(4)	
	
*Test-Hyp21: The effect of touch on Percieved affection will vary by relationship quality. WITHIN CONFLICT CONTEXT
	reg perc_affection c.maritalquality##i.touch if conflict==1
	// reject. 0.424	
	tess c.maritalquality#1.touch, bonf(4)	
	
*Test-Hyp22: The effect of touch on State security will vary by relationship quality. WITHIN CONFLICT CONTEXT
	reg security c.maritalquality##i.touch if conflict==1
	// reject. 0.297		
	tess c.maritalquality#1.touch, bonf(4)	
	
*Test-Hyp23: The effect of touch on Cognitive interdependence will vary by relationship quality.	WITHIN CONFLICT CONTEXT
	reg interdependence c.maritalquality##i.touch if conflict==1
	// reject. 0.859		
	tess c.maritalquality#1.touch, bonf(4)	
	
*Test-Hyp24: The effect of touch on Social inclusion will vary by relationship quality. WITHIN CONFLICT CONTEXT		
	reg inclusion c.maritalquality##i.touch if conflict==1
	// reject. 0.250
	tess c.maritalquality#1.touch, bonf(4)	
	
	
	
*Test-Hyp25: Percieved affection will be higher in touch vs. no touch condition. WITHIN NEUTRAL CONTEXT
	reg perc_affection i.touch if conflict==0
	// do not reject. 0.006		
	tess 1.touch +, bonf(4)	
	
*Test-Hyp26: State security will be higher in touch vs. no touch condition.	WITHIN NEUTRAL CONTEXT
	reg security i.touch if conflict==0
	// do not reject. 0.000
	tess 1.touch +, bonf(4)	
	
*Test-Hyp27: Cognitive interdependence will higher in touch vs. no touch condition. WITHIN NEUTRAL CONTEXT
	reg interdependence i.touch if conflict==0
	// do not reject. 0.001
	tess 1.touch +, bonf(4)	
	
*Test-Hyp28: Social inclusion will be higher in touch vs. no touch condition. WITHIN NEUTRAL CONTEXT
	reg inclusion i.touch if conflict==0
	// reject. 0.918
	tess 1.touch +, bonf(4)	
	
*Test-Hyp29: Percieved affection will increase with relationship quality. WITHIN NEUTRAL CONTEXT
	reg perc_affection maritalquality if conflict==0
	// do not reject. 0.000
	tess maritalquality +, bonf(4)
	
*Test-Hyp30: State security will increase with relationship quality. WITHIN NEUTRAL CONTEXT
	reg security maritalquality if conflict==0
	// do not reject. 0.000
	tess maritalquality +, bonf(4)
	
*Test-Hyp31: Cognitive interdependence will increase with relationship quality. WITHIN NEUTRAL CONTEXT
	reg interdependence maritalquality if conflict==0
	// do not reject. 0.000	
	tess maritalquality +, bonf(4)
	
*Test-Hyp32: Social inclusion will increase with relationship quality. WITHIN NEUTRAL CONTEXT
	reg inclusion maritalquality if conflict==0
	// do not reject. 0.000
	tess maritalquality +, bonf(4)
	
*Test-Hyp33: The effect of touch on Percieved affection will vary by relationship quality. WITHIN NEUTRAL CONTEXT
	reg perc_affection c.maritalquality##i.touch if conflict==0
	// reject. 0.274	
	tess c.maritalquality#1.touch, bonf(4)	
	
*Test-Hyp34: The effect of touch on State security will vary by relationship quality. WITHIN NEUTRAL CONTEXT
	reg security c.maritalquality##i.touch if conflict==0
	// reject. 0.162		
	tess c.maritalquality#1.touch, bonf(4)	
	
*Test-Hyp35: The effect of touch on Cognitive interdependence will vary by relationship quality.	WITHIN NEUTRAL CONTEXT
	reg interdependence c.maritalquality##i.touch if conflict==0
	// reject. 0.369		
	tess c.maritalquality#1.touch, bonf(4)	
	
*Test-Hyp36: The effect of touch on Social inclusion will vary by relationship quality. WITHIN NEUTRAL CONTEXT		
	reg inclusion c.maritalquality##i.touch if conflict==0
	// reject. 0.063	
	tess c.maritalquality#1.touch, bonf(4)	
